package com.briup.framework.utils.web;

/**
 * @Author guomiao
 * @Date 2022/3/3 14:56
 */

public enum ResponseCode {
    /*默认成功，默认失败*/
    SUCCESS(200,"OK"),
    ERROR(500,"系统内部错误，请稍后重试"),

    BASE_ERROR(5001,"基础服务失败！"),

    /* 数据校验失败 */
    DATA_VALIDATE_ERROR(1001, "数据校验失败"),

    /* 用户错误：2001-2999*/
    USER_NOT_LOGIN(2001, "用户未登录"),
    INVALID_TOKEN(2007, "令牌失效"),
    USER_LOGIN_ERROR(2002, "登录失败"),
    USER_EXISTED(2003, "用户已存在"),
    USER_NOT_EXISTED(2004, "用户不存在"),
    USER_ACCOUNT_FORBIDDEN(2005, "账号已被禁用"),
    USER_ACCESS_DENY(2006,"无访问权限！"),

    /* 资源错误：4001-4999 */
    RESOURCE_NOT_FOUND(4004, "访问的资源不存在"),

    DATA_WRONG(5002, "数据错误"),
    DATA_EXISTED(5003, "数据已存在"),
    DATA_NOT_FOUND(5004, "数据不存在"),
    NAME_EMPTY(5005, "名称为空"),
    NAME_EXISTED(5006,"名称重复");

    private Integer code;
    private String status;

    ResponseCode(Integer code, String status) {
        this.code = code;
        this.status = status;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }
}
